<div class="col-md-9">
  <div class="outer-border">

	<div id="carousel-example-generic" class="carousel slide">
	  <!-- Indicators -->
	  <ol class="carousel-indicators">
		<?php
			$sttmt = $koneksi->query("select id_slider from slider where aktif = 'Y'");
			$row_count = $sttmt->rowCount();
			$aktif = "class = active";
			for($i=0;$i<$row_count;$i++){
				echo "<li data-target='#carousel-example-generic' data-slide-to='$i' $aktif></li>";
				$aktif = "";
			}
		?>
	  </ol>

	  <!-- Wrapper for slides -->
	  <div class="carousel-inner">
		<?php
			$sttmt = $koneksi->query("select * from slider where aktif = 'Y'");
			$aktif = "active";
			while($row = $sttmt->fetch(PDO::FETCH_ASSOC)){
				?>
					<div class="item <?php echo $aktif; ?>">
					  <img src="slider/<?php echo $row['gambar']; ?>" alt="<?php echo $row['judul']; ?>">
					</div>
				<?php
				$aktif="";
			}
		?>
	  </div>

	  <!-- Controls -->
	  <a class="left carousel-control" href="#carousel-example-generic" data-slide="prev">
		<span class="icon-prev"></span>
	  </a>
	  <a class="right carousel-control" href="#carousel-example-generic" data-slide="next">
		<span class="icon-next"></span>
	  </a>
	</div>

  <div class="clearfix"></div>
  </div>

  <!-- random product -->
  <div class="span12">
	<div class="outer-border nav-page-sidebar-p10">
	  <div class="nav-judul bg-texture margin-bottom">
		<span class="judul-sidebar">
		  Produk Acak
		</span>
	  <div class="clearfix"></div>
	  </div>
	  <div class="row">
		<!-- 1 produk -->
		<?php
			$sttmt = $koneksi->query("select * from produk order by rand() limit 6");
			while($hasil = $sttmt->fetch(PDO::FETCH_ASSOC)){
		?>
				<div class="col-md-4">
				  <div class="outer-noradius">
					<div class="kotak-produk">
					  <center>
						<img src="<?php echo "produk/$hasil[gambar]"; ?>">
					  </center>
					  <h1> <?php echo $hasil['kode']; ?>
						   <br /><?php echo $hasil['nama_produk']; ?></h1>
					  <p class="harga">
						<?php 
							if($_SESSION['id_member'] != 'BOS000' && $hasil['diskon_member'] != 0){
								$harga = $hasil['harga'] * ((100 - $hasil['diskon_member'])/100);
								echo "<s>".harga($hasil['harga'])."</s> &nbsp; $harga"; 
							}else if($_SESSION['id_member'] == 'BOS000' && $hasil['diskon_umum'] != 0){
								$harga = $hasil['harga'] * ((100 - $hasil['diskon_member'])/100);
								echo "<s>".harga($hasil['harga'])."</s> &nbsp; $harga";
							}else{
								echo harga($hasil['harga']);
							}
						?>
					  </p>
					  <p>
						<?php
						echo "<a href='produk-$hasil[slug]'> 
								<button type='button' class='btn btn-info btn-xs'>
									Detail									
								</button>
							</a>";
							$stok = $koneksi->query("select sum(stok) as jumlah from stok where id_produk = $hasil[id_produk]");
							$s = $stok->Fetch(PDO::FETCH_ASSOC);
							$jml = number_format($s['jumlah']);
							if($jml == 0){
							echo "<button type='button' class='btn btn-danger btn-xs'>
									Stok Habis									
								</button>";
							}
						?>
					  </p>
					</div>
				  <div class="clearfix"></div>
				  </div>
				<div class="clearfix"></div>
				</div>
		<?php
			}
		?>
  <!-- end random product -->
</div>